class P10188 {

	private static int cursor;

	public static void main(String[] args) {
		int counter = 1;
		String line = readLn();
		while (!"0".equals(line.trim())) {
//			System.out.println(line);
			System.out.print("Run #" + counter + ": ");
			counter++;
			process(Integer.parseInt(line.trim()));
			line = readLn();
		}
	}

	private static void process(int n) {
		String solutions = readLn(n);
		
		int m = Integer.parseInt(readLn().trim());
		
		String answers = readLn(m);
//		
//		System.out.println();
//		System.out.println(solutions);
//		System.out.println(answers);
//		System.out.println();
		
		if (solutions.equals(answers)) {
			System.out.println("Accepted");
			return;
		}
		
		int length = solutions.length();
		
		cursor = 0;
		
		for (int k = 0; k < length; k++) {
			char c = solutions.charAt(k);
			if (Character.isDigit(c)) {
				if (!getNextDigit(c, answers)) {
					System.out.println("Wrong Answer");
					return;
				}
			}
		}

		length = answers.length();
		
		cursor = 0;
		
		for (int k = 0; k < length; k++) {
			char c = answers.charAt(k);
			if (Character.isDigit(c)) {
				if (!getNextDigit(c, solutions)) {
					System.out.println("Wrong Answer");
					return;
				}
			}
		}

		
		System.out.println("Presentation Error");
	}

	private static boolean getNextDigit(char c, String answers) {
		int length = answers.length();
		for (int k = cursor; k < length; k++) {
			char x = answers.charAt(k);
			if (c == x) {
				cursor = k + 1;
				return true;
			} else if (Character.isDigit(x)) {
				return false;
			}
		}
		return false;
	}

	static String readLn(int counter) {
		int k = 0;
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			
			while (true) {
				car = System.in.read();
				
				if (car == -1) break;
				
				buffer.append((char) car);
				if (car == '\n') k++;
				if (counter == k) break;
				
			}
		} catch (java.io.IOException e) {
			return (null);
		}
		return (buffer.toString());
	}

	
	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
//			if (car == newLine.charAt(0))
//				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}

}
